﻿
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Registro.Compras.Data.Entities;

namespace Registro.Compras.Data.Business
{
    public class Tabla10Business
    {

        public static IList<Tabla10> GetListByFilter(string filter)
        {

            using (RegistroComprasDbContext ctx = new RegistroComprasDbContext())
            {
                return ctx.Tabla10s.Where(t => t.Descripcion.Contains(filter)).ToList();
            }
        }
        public static Tabla10 GetById(int id)
        {
            using (RegistroComprasDbContext ctx = new RegistroComprasDbContext())
            {
                Tabla10 Tabla10DB = ctx.Tabla10s.Find(id);
                if (Tabla10DB == null)
                {
                    throw new Exception("Tabla10 not found in data base");
                }
                return Tabla10DB;
            }
        }
    }
}